# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=skyjack
pkgver=16.24e3878
pkgrel=2
groups=('blackarch' 'blackarch-drone')
pkgdesc='Takes over Parrot drones, deauthenticating their true owner and taking over control, turning them into zombie drones under your own control.'
arch=('any')
url='https://github.com/samyk/skyjack'
license=('GPL')
depends=('node-ar-drone' 'net-tools')
makedepends=('git')
optdepends=('aircrack-ng: putting wireless card in monitor mode')
source=("git+https://github.com/samyk/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i 's|drone_control|/usr/share/skyjack|' "$pkgname.pl"
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/share/$pkgname"

  install -Dm 755 "$pkgname.pl" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md

  cp -a drone_control/* "$pkgdir/usr/share/$pkgname"
}

